#!/bin/sh
# ------------------------------------------------------------------------------
# Simple script to build the jam executable from sources

TARGET="${OS}${COM}"

if test $TARGET = "WNTMSC"; then
#    CC=cl /nologo
CFLAGS="-nologo -DNT -Fejam.exe"
else
#    CC=cc
CFLAGS="-o ./jam"
fi


# Windows, MSVC
if test $TARGET = "WNTMSC"; then
    OSCODE="execunix.c filent.c pathunix.c"
#elif test $TARGET = "WNTGCC"; then
#    OSCODE="execunix.c filent.c pathunix.c"
#elif test $TARGET = "OS2"; then
#    OSCODE="execunix.c fileos2.c pathunix.c"
#elif test $TARGET = "MAC"; then
#    OSCODE=execmac.c filemac.c pathmac.x
else
    OSCODE="execunix.c fileunix.c pathunix.c"
fi

SRC="builtins.c command.c compile.c $OSCODE expand.c \
glob.c hash.c headers.c lists.c make.c make1.c \
newstr.c option.c parse.c regexp.c rules.c scan.c \
search.c timestamp.c variable.c jamgram.c jambase.c jam.c"

# compile
cd src
$CC $CFLAGS $SRC
cd ..
